How can I modify my Python code to write a dictionary to a file without errors

visit shbcf.ru